package test;

import java.util.Scanner;

public class password {
    public static void main(String[] args) {
        int i = 0;
        int a = 0, b = 0, c = 0, d = 0, e = 0;
        String line;
        System.out.println("请输入字符串");
        Scanner sc = new Scanner(System.in);
        line = sc.next();
        String tmp;
        while (i < line.length()) {
            tmp = line.substring(i, i + 1);
            if (tmp.compareTo("a") >= 0 && tmp.compareTo("z") <= 0) {
                a++;
            } else if (tmp.compareTo("A") >= 0 && tmp.compareTo("Z") <= 0) {
                b++;
            } else if (tmp.compareTo("0") >= 0 && tmp.compareTo("9") <= 0) {
                c++;
            } else if (tmp.charAt(0) == 32) {
                d++;
            } else {
                e++;
            }
            i++;
        }
        System.out.println("小写字母有：" + a);
        System.out.println("大写字母有：" + b);
        System.out.println("数字有：" + c);
        System.out.println("特殊字符有：" + e);
    }
}
